package tfts

type stackType int

const (
	NoStk stackType = iota
	AsStk
	CastStk
	AtkStk
)

type skill struct {
	callable
	next *skill
}

func (s *skill) cast(champ *Fight) {
	// 施法技能前先添加buff
	// 使技能可以享受到buff加成
	if s.buff != nil {
		s.buff.attach(champ)
	}
	champ.CastTimes++
	shield := s.defence(champ)
	if s.duration > 0 && shield != nil {
		champ.locks = append(champ.locks, shield)
	}
	if s.next != nil {
		champ.skill = s.next
	}
}
